#pragma once
#include "afxdockablepane.h"
#include "BEdit.h"
class MPane :
	public CDockablePane
{
public:
	
	DECLARE_DYNAMIC( MPane)
public:
	CSW_BDisplay bdisplay;
	MPane()
	{
	}
	virtual ~MPane()
	{

	}
	
	int OnCreate(LPCREATESTRUCT lpcs)
	{
		if(CDockablePane::OnCreate(lpcs) == -1)
			return -1;
		RECT rt;
		GetClientRect(&rt);
		bdisplay.Create(WS_VISIBLE, rt, this);
		bdisplay.SetEndless( TRUE);
		if (bdisplay.SetDataPtr( 0x00400000, 0x1000)) {
			bdisplay.SetScrollPos( SB_VERT, 0);
			bdisplay.SetScrollPos( SB_HORZ, 0);
			bdisplay.Invalidate();
		}
		return 0;
	}
	void OnSize(UINT nType, int cx, int cy)
	{
		CDockablePane::OnSize(nType, cx, cy);
		bdisplay.SetWindowPos(NULL, 0,0, cx, cy, SWP_NOMOVE);
		bdisplay.Invalidate();
	}
	DECLARE_MESSAGE_MAP()
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnPaint();

	
};

